-- GENERATED SPELL FOR [Vashj'ir Honor Guard] --


function spell0_21218(pUnit, Event) --@Execute,n/a--
pUnit:FullCastSpellOnTarget(38959,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21218', 0, 1)
end

function spell1_21218(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(38947,pUnit)
pUnit:RegisterEvent('Sorts_21218', 540, 1)
end

function spell2_21218(pUnit, Event) --@Frightening Shout,n/a--
pUnit:FullCastSpellOnTarget(38945,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21218', 6254, 1)
end

function spell3_21218(pUnit, Event) --@Knockback,Self--
pUnit:FullCastSpellOnTarget(38576,pUnit)
pUnit:RegisterEvent('Sorts_21218', 606, 1)
end

function spell4_21218(pUnit, Event) --@Mortal Cleave,n/a--
pUnit:FullCastSpellOnTarget(38572,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21218', 8350, 1)
end

function Sorts_21218(pUnit, Event)
local choix_sorts_21218 = math.random(0, 4)
if choix_sorts_21218 == 0 then
pUnit:RegisterEvent('spell0_21218', 1, 1)
end
if choix_sorts_21218 == 1 then
pUnit:RegisterEvent('spell1_21218', 1, 1)
end
if choix_sorts_21218 == 2 then
pUnit:RegisterEvent('spell2_21218', 1, 1)
end
if choix_sorts_21218 == 3 then
pUnit:RegisterEvent('spell3_21218', 1, 1)
end
if choix_sorts_21218 == 4 then
pUnit:RegisterEvent('spell4_21218', 1, 1)
end
end

function mob21218_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21218', math.random(1500, 3000), 1)
end

function mob21218_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21218_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21218_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21218, 1, 'mob21218_Action')
RegisterUnitEvent(21218, 2, 'mob21218_Leave')
RegisterUnitEvent(21218, 3, 'mob21218_Kill')
RegisterUnitEvent(21218, 4, 'mob21218_Die')
